package com.zhou.springcloud.cf.controller;

import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhouyongjun
 * @Description:
 * @date 2021/3/27 11:18
 */
@RestController
public class ConfigClietnController {
    @Value("${spring.application.name}")
    String appliationName;
    @Value("${eureka.client.service-url.defaultZone}")
    String eurekaServer;
    @Value("${server.port}")
    String port;
    @GetMapping("config")
    public JSONObject getConfig() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("appliationName",appliationName);
        jsonObject.put("eurekaServer",eurekaServer);
        jsonObject.put("port",port);
        return jsonObject;
    }
}
